﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QD.Tools
{
    public static class TreeViewHelper
    {
        /// <summary>
        /// 复制一个选中节点的文本
        /// </summary>
        /// <param name="tree"></param>
        public static void CopyFirstSelectedNodeText(this TreeView tree)
        {
            TreeNode node = tree.SelectedNode;
            if (node != null)
            {
                Clipboard.Clear();
                Clipboard.SetText(node.Text);
            }
        }
    }
}
